import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';
import Layout from '@/layout/index.vue';

const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: '/',
      redirect: '/layout'
    },
    {
      path: '/layout',
      name: 'Layout',
      component: Layout,
      redirect: '/layout/home',
      children: [
        {
          path: 'welcome',
          name: 'Welcome',
          component: () => import('@/views/Welcome.vue'),
          meta: {
            title: 'Welcome',
            affix: false,
            cache: false
          }
        },
        {
          path: 'about',
          name: 'About',
          component: () => import('@/views/About.vue'),
          meta: {
            title: 'About',
            affix: false,
            cache: false
          }
        },
        {
          path: 'home',
          name: 'Home',
          component: () => import('@/views/Home.vue'),
          meta: {
            title: 'Home',
            affix: false,
            cache: false
          }
        }
      ]
    }
  ]
});

export default router;
